package org.tacademy.basic.calendar;


public class ItemData implements CalendarManager.CalendarComparable<ItemData>{
	public int year;
	public int month;
	public int day;
	public String title;
	public String content;
	public String time;
	public String location;
	
	public ItemData(){
		
	}
	
	public ItemData(int year,int month,int day,String title, String content) {
		this.year = year;
		this.month = month-1;
		this.day = day;
		this.title = title;
		this.content = content;
	}
	
	@Override
	public int compareDate(int year, int month, int day) {
		// TODO Auto-generated method stub
		return ((this.year - year) * 12 + (this.month - month)) * 31 + this.day - day;
	}
	
	@Override
	public int compareToUsingCalendar(ItemData another) {
		// TODO Auto-generated method stub
		return ((this.year - another.year) * 12 + (this.month - another.month)) * 31 + this.day - another.day;
	}
	
}
